<script setup lang="ts">
import Home from '../home/home.vue'
import Manager from '../manager/manager.vue'
import My from '../my/my.vue'

const TabbarPages = [Home, Manager, My]
const current = ref(0)
const handleTabbarPageChange = (idx: number) => (current.value = idx)
</script>

<template>
  <view>
    <view>
      <component :is="TabbarPages[current]" />
    </view>
    <up-tabbar :value="current" @change="handleTabbarPageChange">
      <up-tabbar-item text="首页" icon="home"></up-tabbar-item>
      <up-tabbar-item text="管理" icon="grid"></up-tabbar-item>
      <up-tabbar-item text="我的" icon="account"></up-tabbar-item>
    </up-tabbar>
  </view>
</template>

<style scoped lang="scss"></style>
